#装饰器的使用
#函数运行的时间
import time

def func(fun):
    def inner():
        begin = time.time()
        fun()
        end = time.time()
        print("函数运行时间",end-begin)
    return inner

@func # work = func(work) work = inner
def work():
    for i in range(10000):
        print(i)
work()